/**
 * 本文件功能: 公共CSS样式
 * 作者信息: 15058593138@qq.com(手机号同微信)
 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #f5f5f5;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0px;
}

/* 公共头部 */
.header {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 5px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.header-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.header-user {
    font-size: 14px;
    color: #666;
}

/* 导航栏 */
.nav-tabs {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    background: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    flex-shrink: 0;
    padding: 8px 12px;
    color: #666;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-tab:hover {
    color: #1890ff;
}

.nav-tab.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 6px 9px;
    font-size: 14px;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-default {
    background: #fff;
    color: #333;
    border: 1px solid #d9d9d9;
}

.btn-default:hover {
    color: #40a9ff;
    border-color: #40a9ff;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 表单 */
.form-group {
    margin-bottom: 8px;
}

.form-label {
    display: block;
    margin-bottom: 1px;
    color: #333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 6px 9px;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

textarea.form-control {
    min-height: 60px;
    resize: vertical;
}

/* 表格 */
.table-wrapper {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.table-title {
    font-size: 16px;
    font-weight: bold;
}

.table-tools {
    display: flex;
    gap: 8px;
    align-items: center;
}

.table-tools select,
.table-tools input {
    padding: 6px 9px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 6px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #fafafa;
    font-weight: 500;
    color: #333;
}

tr:hover td {
    background: #f5f5f5;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
}

.page-btn {
    padding: 6px 9px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover:not(.disabled) {
    color: #1890ff;
    border-color: #1890ff;
}

.page-btn.disabled {
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-select {
    padding: 6px 9px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
}

/* 遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-box {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 16px;
    font-weight: bold;
}

.modal-close {
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 8px 12px;
    border-top: 1px solid #eee;
}

/* 吐司提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 登录页面 */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #333;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* 进度条 */
.progress {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: #1890ff;
    transition: width 0.3s;
}

/* 标签 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #666;
}

.badge-primary {
    background: #e6f7ff;
    color: #1890ff;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
}

.badge-danger {
    background: #fff1f0;
    color: #ff4d4f;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 5px;
    }
    
    .header-top {
        padding: 10px;
    }
    
    .nav-tab {
        padding: 6px 8px;
    }
    
    .table-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .table-tools {
        width: 100%;
        flex-wrap: wrap;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 5px;
    }
    
    .modal-box {
        width: 95%;
    }
}
